package com.icongyou.enterprise.talent_marking;

import com.icongyou.enterprise.talent_marking.service.StudentPerformanceTrackingService;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;;

@ExtendWith(MockitoExtension.class)
class StudentPerformanceTrackingServiceTest {

    @Mock
    private StudentPerformanceTrackingService studentPerformanceTrackingService;

    @Test
    void simplifiedWeeklyTracking_ShouldExecuteSuccessfully() {
        // Arrange
        doNothing().when(studentPerformanceTrackingService).simplifiedWeeklyTracking();

        // Act
        studentPerformanceTrackingService.simplifiedWeeklyTracking();

        // Assert
        verify(studentPerformanceTrackingService, times(1)).simplifiedWeeklyTracking();
    }

    @Test
    void simplifiedWeeklyTracking_WhenCalledMultipleTimes_ShouldExecuteCorrectly() {
        // Arrange
        doNothing().when(studentPerformanceTrackingService).simplifiedWeeklyTracking();

        // Act - 调用多次
        studentPerformanceTrackingService.simplifiedWeeklyTracking();
        studentPerformanceTrackingService.simplifiedWeeklyTracking();
        studentPerformanceTrackingService.simplifiedWeeklyTracking();

        // Assert
        verify(studentPerformanceTrackingService, times(3)).simplifiedWeeklyTracking();
    }

    @Test
    void simplifiedWeeklyTracking_ShouldCompleteWithoutExceptions() {
        // Arrange
        doNothing().when(studentPerformanceTrackingService).simplifiedWeeklyTracking();

        // Act & Assert - 确保方法执行不会抛出异常
        assertDoesNotThrow(() -> {
            studentPerformanceTrackingService.simplifiedWeeklyTracking();
        });

        // Verify
        verify(studentPerformanceTrackingService).simplifiedWeeklyTracking();
    }
}
